package com.prs.crm.action.oa;

import java.util.Collection;

import org.apache.struts2.convention.annotation.Action;
import org.courser.struts.BaseAction;

import com.prs.crm.context.AppContext;
import com.prs.crm.domain.hr.Person;
import com.prs.crm.domain.oa.Memo;
import com.prs.crm.domain.oa.Notice;
import com.prs.crm.domain.oa.OaTaskSubmit;
import com.prs.crm.domain.oa.Schedule;
import com.prs.crm.service.oa.ApplyAuditService;
import com.prs.crm.service.oa.MemoService;
import com.prs.crm.service.oa.NoticeService;
import com.prs.crm.service.oa.OaTaskSubmitService;
import com.prs.crm.service.oa.ScheduleService;

public class IndexAction  extends BaseAction{
	private ApplyAuditService applyAuditService;	
	private MemoService memoService;	
	private ScheduleService scheduleService;
	private NoticeService noticeService;	
	private OaTaskSubmitService oaTaskSubmitService;
	
	private Collection<Memo> memos;	
	private Collection<Notice> notices;	
	private Collection<Schedule> schedules;
	private Collection<Schedule> exeSchedules;
	private Collection<Schedule> auditSchedules;	
	private Collection<OaTaskSubmit> exeOaTaskSubmits;
	private Collection<OaTaskSubmit> auditOaTaskSubmits;
	
	@Action("index")
	public String index() {
		Person person = AppContext.getAccountContext().currentUser();
		memos = this.getMemoService().getUndealMemo(person);
		notices = this.getNoticeService().getUnreadNotice(person);
		exeSchedules = this.getScheduleService().getExecuteSchedule(person);
		setAuditSchedules(this.getScheduleService().getAuditSchedule(person));
//		synods = this.getSynodService().getSynod(person, Util.nowFullTime());
		exeOaTaskSubmits = this.getOaTaskSubmitService().getExecuteTask(person);
		auditOaTaskSubmits = this.getOaTaskSubmitService().getAuditTask(person);
		return SUCCESS;
	}

	public ApplyAuditService getApplyAuditService() {
		return applyAuditService;
	}

	public void setApplyAuditService(ApplyAuditService applyAuditService) {
		this.applyAuditService = applyAuditService;
	}

	public MemoService getMemoService() {
		return memoService;
	}

	public void setMemoService(MemoService memoService) {
		this.memoService = memoService;
	}

	public ScheduleService getScheduleService() {
		return scheduleService;
	}

	public void setScheduleService(ScheduleService scheduleService) {
		this.scheduleService = scheduleService;
	}

	public NoticeService getNoticeService() {
		return noticeService;
	}

	public void setNoticeService(NoticeService noticeService) {
		this.noticeService = noticeService;
	}

	public OaTaskSubmitService getOaTaskSubmitService() {
		return oaTaskSubmitService;
	}

	public void setOaTaskSubmitService(OaTaskSubmitService oaTaskSubmitService) {
		this.oaTaskSubmitService = oaTaskSubmitService;
	}

	public Collection<Memo> getMemos() {
		return memos;
	}

	public void setMemos(Collection<Memo> memos) {
		this.memos = memos;
	}

	public Collection<Notice> getNotices() {
		return notices;
	}

	public void setNotices(Collection<Notice> notices) {
		this.notices = notices;
	}

	public Collection<Schedule> getSchedules() {
		return schedules;
	}

	public void setSchedules(Collection<Schedule> schedules) {
		this.schedules = schedules;
	}

	public Collection<Schedule> getExeSchedules() {
		return exeSchedules;
	}

	public void setExeSchedules(Collection<Schedule> exeSchedules) {
		this.exeSchedules = exeSchedules;
	}

	public Collection<Schedule> getAuditSchedules() {
		return auditSchedules;
	}

	public void setAuditSchedules(Collection<Schedule> auditSchedules) {
		this.auditSchedules = auditSchedules;
	}

	public Collection<OaTaskSubmit> getExeOaTaskSubmits() {
		return exeOaTaskSubmits;
	}

	public void setExeOaTaskSubmits(Collection<OaTaskSubmit> exeOaTaskSubmits) {
		this.exeOaTaskSubmits = exeOaTaskSubmits;
	}

	public Collection<OaTaskSubmit> getAuditOaTaskSubmits() {
		return auditOaTaskSubmits;
	}

	public void setAuditOaTaskSubmits(Collection<OaTaskSubmit> auditOaTaskSubmits) {
		this.auditOaTaskSubmits = auditOaTaskSubmits;
	}
}
